import random

from selenium.webdriver.common.by import By

from base import BaseAction


class JsGdPageHome(BaseAction):
    menu_js_gd_ele = By.XPATH, '//*[@id="JS-gdzj"]'  # 技师点固定正畸
    search1_js_ele = By.XPATH, '//*/form/div[3]/div/div/div'  # 点击筛选框
    search2_js_ele = By.XPATH, '//p//*[text()="技师待接收"]'  # 筛选病例
    input_search_js_ele = By.XPATH, '//*[@placeholder="病例编号/患者姓名"]/input'  # 搜索病例
    search_js_button_ele = By.XPATH, '//*[text()="查询"]'  #
    receive_js_ele = By.XPATH, '//tr[1]//*[text()="接收病例"]'  # 接收按钮
    receive_js_button_ele = By.XPATH, '//*[text()="接收"]'  # 确认接收
    details_ele = By.XPATH, '//tr[1]//*[text()="详情"]'
    see_model_ele = By.XPATH, '//li[4]//span[text()="查看"]'
    see_model_success_ele = By.XPATH, '//*[text()="0%"]'  # 校验有没有加载完成有元素0%
    see_model_close_ele = By.XPATH, '//*/span[8]/i'  # 关闭页面
    # 准备进入设计工具
    design_ele = By.XPATH, '//*[text()="设计方案"]'
    okbtn_ele = By.CLASS_NAME, 'okbtn'
    success_next_ele = By.XPATH, '//*[text()="0%"]'
    next_fenya_ele1 = By.XPATH, '//*[@id="mainAppcom"]/div[2]/div[1]/div[1]/div[1]/div/div[1]/div[2]/p[text()="下一步"]'  # 第一个页面的下一步
    over_ele = By.XPATH, '//*[text()="完成"]'
    # 排牙
    ai_ele = By.XPATH, '//*[@class="date200819_pygj_wrap"]/div[4]'  # 点击自动排牙 拔牙4-4并确认
    ba_ele = By.XPATH, '//*[@class="byBtnWrap"]/div[2]/div'
    ba_ok_ele = By.XPATH, '//*[@id="mainAppcom"]//div[8]//div[1]/span[text()="确认"]'
    collision_ele = By.XPATH, '//*/div[5]/div[3]/div[9]'  # 碰撞
    occlusion_ele = By.XPATH, '//*/div[5]/div[3]/div[7]'  # 咬合
    row_teeth_next_ele = By.XPATH, '//*[@step="3"]/div[2]//p[text()="下一步"]'  # 排牙页面的下一步按钮
    # 托槽
    bracket_ele = By.XPATH, '//li[1][text()="托槽数据库"]'
    pt_ele1 = By.XPATH, '//*[text()="PT 5 Plus Bracket"]'
    pt_ele2 = By.XPATH, '//*[@id="mainAppcom"]//div[9]//span[text()="确认"]'
    leveling_ele = By.XPATH, '//*[text()="托槽与弓丝整平"]'
    no_gap_ele = By.XPATH, '//*[text()="托槽无间隙位置"]'
    bracket_next_ele = By.XPATH, '//*[@id="mainAppcom"]/div[2]/div[1]/div[1]/div[2]/div/div[1]/div[2]/p[text()="下一步"]'  # 托槽页面的下一步
    # 报告
    sumbit1_ele = By.XPATH, '//*[@title="提交方案"]'  # 提交
    sumbit2_ele = By.XPATH, '//*//div[13]//span[text()="确认"]'  # 会自动返回业务端
    sumbit3_ele = By.XPATH, '//*[text()="方案提交成功"]'  # 会自动返回业务端
    # 导板
    guide_plate_design_ele = By.XPATH, '//*[text()="导板设计"]'  # 点击导板设计
    edit1_group_ele = By.XPATH, '//*/div[2]/div[1]/div[1]/div[2]/div/div[3]/ul/li[1]'  # 点击编辑分组
    edit2_group_ele = By.XPATH, '//*/div[2]/div[1]/div[1]/div[2]/div/div[3]/ul/li[2]'  # 点击整平平面
    edit3_group_ele = By.XPATH, '//*/div[2]/div[1]/div[1]/div[2]/div/div[3]/ul/li[4]'  # 点击生成导板

    # 技师点击固定正畸菜单栏
    def get_menu_js_gd_ele(self):
        return self.get_element(self.menu_js_gd_ele)

    def get_search1_js_ele(self):
        return self.get_element(self.search1_js_ele)

    def get_search2_js_ele(self):
        return self.get_element(self.search2_js_ele)

    def get_search_js_button_ele(self):
        return self.get_element(self.search_js_button_ele)

    def get_receive_js_ele(self):
        return self.get_element(self.receive_js_ele)

    def get_receive_js_button_ele(self):
        return self.get_element(self.receive_js_button_ele)

    def get_details_ele(self):
        return self.get_element(self.details_ele)

    def get_see_model_ele(self):
        return self.get_element(self.see_model_ele)

    def get_see_model_success_ele(self):
        return self.get_element(self.see_model_success_ele)

    def get_see_model_close_ele(self):
        return self.get_element(self.see_model_close_ele)

    # 进入设计工具分牙------------------------------------------------------------
    def get_design_ele(self):
        return self.get_element(self.design_ele)

    def get_okbtn_ele(self):
        return self.get_element(self.okbtn_ele)

    def get_success_next_ele(self):
        return self.get_element(self.success_next_ele)

    def get_next_fenya_ele1(self):
        return self.get_element(self.next_fenya_ele1)

    def get_over_ele(self):
        return self.get_element(self.over_ele)

    # 进入排牙------------------------------------------------------------
    def get_ai_ele(self):  # AI排牙
        return self.get_element(self.ai_ele)

    def get_ba_ele(self):
        return self.get_element(self.ba_ele)

    def get_ba_ok_ele(self):
        return self.get_element(self.ba_ok_ele)

    def get_collision_ele(self):  # 咬合
        return self.get_element(self.collision_ele)

    def get_occlusion_ele(self):  # 碰撞
        return self.get_element(self.occlusion_ele)

    def get_row_teeth_next_ele(self):  # 进入托槽
        return self.get_element(self.row_teeth_next_ele)

    # 进入托槽------------------------------------------------------------
    def get_bracket_ele(self):
        return self.get_element(self.bracket_ele)

    def get_pt_ele1(self):
        return self.get_element(self.pt_ele1)

    def get_pt_ele2(self):
        return self.get_element(self.pt_ele2)

    def get_leveling_ele(self):
        return self.get_element(self.leveling_ele)

    def get_no_gap_ele(self):
        return self.get_element(self.no_gap_ele)

    def get_bracket_next_ele(self):
        return self.get_element(self.bracket_next_ele)

    # 进入报告------------------------------------------------------------
    def get_sumbit1_ele(self):
        return self.get_element(self.sumbit1_ele)

    def get_sumbit2_ele(self):
        return self.get_element(self.sumbit2_ele)

    def get_sumbit3_ele(self):
        return self.get_element(self.sumbit3_ele)

    # 进入导板
    def get_input_search_js_ele(self):
        return self.get_element(self.input_search_js_ele)

    def get_guide_plate_design_ele(self):  # 点击导板设计
        return self.get_element(self.guide_plate_design_ele)

    def get_edit1_group_ele(self):  # 分组
        return self.get_element(self.edit1_group_ele)

    def get_edit2_group_ele(self):  # 整平
        return self.get_element(self.edit2_group_ele)

    def get_edit3_group_ele(self):  # 生成导板
        return self.get_element(self.edit3_group_ele)
